<?php
$AppUI->savePlace();

if (! $canAccess) {
	$AppUI->setMsg('Access denied', UI_MSG_ERROR);
	$AppUI->redirect();
}

// To configure an aditional filter to use in the search string
$additional_filter = '';
// retrieve any state parameters
if (isset( $_GET['where'] )) {
	$AppUI->setState( 'SupIdxWhere', $_GET['where'] );
}
if (isset( $_GET['search_string'] )){
	$AppUI->setState ('SupIdxWhere', '%'.$_GET['search_string']);
	// Added the first % in order to find instrings also
	$additional_filter = "OR sup_name like '%{$_GET['search_string']}%'";
}
$tab = isset($_GET['tab']) ? intval($_GET['tab']) : 0;
$where = $AppUI->getState( 'SuptIdxWhere' ) ? $AppUI->getState( 'SupIdxWhere' ) : '%';

// optional fields shown in the list (could be modified to allow breif and verbose, etc)
$showfields = array(
	'sup_name' => 'sup_name',
	'sup_tel' => 'sup_tel'
);


// Let's remove the first '%' that we previously added to ContIdxWhere
$default_search_string = dPformSafe(substr($where, 1, strlen($where)), true);

// setup the title block
$titleBlock = new CTitleBlock( 'Reports' );
$titleBlock->show();

// build new tab box object
$tabBox = new CTabBox('?m=reports', $tab);
//$tabBox = new CTabBox("?m=quotation", "{$dPconfigroot_dir->'root_dir'}/modules/quotation/", $tab);
$tabBox->add('r_reference', 'Reference summary');
$tabBox->add('r_settlement', 'Settlement note');
$tabBox->add('r_handlingfee', 'Detail of handling fee');
$tabBox->show();
?>
